/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-05-12
 * Time: 13:26
 */
public class Student {
    public String name;
    public int age;
    public String stuNum;
    public static String classNum;

    public void eat(){
        System.out.println(name + "正在吃饭！");
    }

    public void doClass(){
        System.out.println(name + "正在上课！");
    }

    public Student(String name, int age, String stuNum) {
        this.name = name;
        this.age = age;
        this.stuNum = stuNum;
    }

    public static void main(String[] args) {
        Student stu1 = null;

        Student.classNum = "1班";

        System.out.println(stu1.classNum);//没有报空指针异常，说明被static修饰的成员变量不依赖与对象
//        System.out.println(Student.classNum);
    }
}
